﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;

namespace ADO_QLNS.Utils
{
    public abstract class AbstractFactory_ADO
    {
        // Luu thong tin chuoi ket noi
        protected static string _ConnectionString;

        // Cac kieu du lieu truu tuong dung de ket noi, thuc thi truy van
        private IDbConnection _connection;
        private IDbCommand _command;
        private IDbDataAdapter _adapter;

        public static string ConnectionString
        {
            get { return _ConnectionString; }
            set { _ConnectionString = value; }
        }

        public IDbConnection Connection
        {
            get { return _connection; }
            set { _connection = value; }
        }

        public IDbCommand Command
        {
            get { return _command; }
            set { _command = value; }
        }

        public IDbDataAdapter Adapter
        {
            get { return _adapter; }
            set { _adapter = value; }
        }

        public abstract void CreateConnection();
        public abstract void CreateCommand(string SqlString);
        public abstract void CreateAdapter(string SqlString);
    }
}
